class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.string :name, :null => false
      t.string :username, :null => false
      t.string :hashed_password, :null => false
      t.string :salt, :null => false
      t.integer :permission, :null => false
      t.timestamps
    end
    User.create(:name => '系统管理员', :username => 'admin', :password => 'admin', :password_confirmation => 'admin', :permission => 1) 
  end

  def self.down
    drop_table :users
  end
end
